#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 1e6 + 5;

int n, m;
char s[N];
int a[N], pos[N];
int d[N];
/*
  I. with x != 0:
  k * x + r == tot
  let x the beauty of substrs,
  let k the number of substrs,
  let tot the total beauty of string.
  given k, x = tot / k, r = tot % k,
  in other words, the number of k,
  equals the number of x.
  so, we only need to check if it is possible
  to split the string into substrs with beauty x.

  II. with x = 0:
  the number of k equas len - tot
 */
void solve() {
  cin >> n;
  rep(i, 1, n) cin >> s[i];
  m = 0;
  rep(i, 1, n) d[i] = 0;
  rep(i, 2, n) {
    a[i] = s[i] != s[i - 1];
    if (a[i]) pos[++m] = i;
  }
  rep(t, 1, m) {
    int i = 0, c = 0;  // the index of beauty, the tolerance of more beauty.
    while (true) {
      i += t;
      if (i > m) break;  // no enough beauty for more substrs
      int L = pos[i];
      int R = i + c + 1 <= m ? pos[i + c + 1] : n + 1;
      d[L]++, d[R]--;
      if (i < m && pos[i + 1] == pos[i] + 1)
        i++;  // r++
      else
        c++;
    }
  }
  rep(i, 1, n) {
    d[i] += d[i - 1];
    a[i] += a[i - 1];
    cout << d[i] + i - a[i] << " \n"[i == n];
  }
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}